package com.qf.qfwemedia.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qf.qfleadnewsmodel.commons.dtos.ResponseResult;
import com.qf.qfleadnewsmodel.wemedia.pojos.WmChannel;
import com.qf.qfwemedia.mapper.WmChannelMapper;
import com.qf.qfwemedia.service.WmChannelService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WmChannelServiceImpl extends ServiceImpl<WmChannelMapper, WmChannel> implements WmChannelService {
    @Override
    public ResponseResult getAll() {

        Wrapper<WmChannel> qw = Wrappers.lambdaQuery(WmChannel.class)
                .eq(WmChannel::getStatus,1)
                .orderByAsc(WmChannel::getOrd);

        List<WmChannel> wmChannels = baseMapper.selectList(qw);
        return ResponseResult.okResult(wmChannels);
    }
}
